/**
 * 公共JS.
 * User: zhaoming
 * Date: 15-8-18
 * Time: 上午11:47
 * To change this template use File | Settings | File Templates.
 */

$(document).ready(function() {

    //初始化表单验证
    $('form').validator({
        theme: 'default',
        stopOnError: false,
        focusInvalid: false,
        ignore: 'hidden'
    });

    $('[data-rel=tooltip]').tooltip();

    $(".form-select2").addClass("width-100").select2().on("select2-close", function (e) {
        $(this).isValid();
    });;

    $(".form_datetime").datetimepicker({
        format : 'yyyy-mm-dd hh:ii:ss',
        language: 'zh-CN',
        autoclose: true
    });

    $(".form_date").datetimepicker({
        format : 'yyyy-mm-dd hh:ii:ss',
        language: 'zh-CN',
        minView: 2,
        autoclose: true
    });

    $(".form_date_begin").datetimepicker({
        format : 'yyyy-mm-dd 00:00:00',
        language: 'zh-CN',
        minView: 2,
        autoclose: true
    });

    $(".form_date_end").datetimepicker({
        format : 'yyyy-mm-dd 23:59:59',
        language: 'zh-CN',
        minView: 2,
        autoclose: true
    });

    $(".form_time").datetimepicker({
        format : 'yyyy-mm-dd hh:ii:ss',
        language: 'zh-CN',
        startView: 1,
        minView: 0,
        maxView: 1,
        autoclose: true
    });
});
